<template>
	<view class="lgDetail">
		<view class="name">
			本期推荐
		</view>
		<rich-text class="intro" :nodes="info.intro"></rich-text>
		<view class="goodsName">
			{{goods.name}}
		</view>
		<view class="img" @click="to(goods)">
			<!-- <image src="https://yueyuan-1319780509.cos.ap-chengdu.myqcloud.com/s2.png" mode="widthFix"></image> -->
			<image :src="goods.mainImageUrl" mode="widthFix"></image>
		</view>
		<view class="toDetail" @click="to(goods)">
			查看更多
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			info: {
				commodityId: 0,
				intro: "",
				introUrl: "",
			},
			goods:{
				name:'',//名称
				brand:'',//品牌
				status: 0,//上下架状态：1.上架 0.下架
				code:'',//产品编码
				facpzryPrice:'',//出厂价
				retailPrice:'',//零售价
				intro:'',//商品简介
				id:'',//商品id
				merchantId:'',//所属商城（平台或推广者）
				styleId:'',//分类id
				model:'',//型号
				material:'',//材质
				colourNo:"",//色号
				series:'',//系列
				sellPoint:'',//风格
				size:'',//尺寸
				place:'',//商品产地
				imageList:[],//图片资源
			},
		}
	},
	onLoad(query) {
		this.info=JSON.parse(query.info)
		this.getDetail(this.info.commodityId);
	},
	onShareAppMessage(){
	},
	onShareTimeline() {
		
	},
	methods:{
		showPopup(url) {
			wx.previewMedia({
				sources:[{
					url:url,
					type: 'image'
				}]
			})
		},
		getDetail(id){
			const requestParam = {
				url: "/app/mall/getCommodityById",
				method: "GET",
				data:{
					commodityId:id
				},
				callBack: (res) => {
					this.goods=res.data;
				}
			}
			this.$request(requestParam);
		},
		to(item){
			uni.navigateTo({
				url: '/pages/detail/index?id='+item.id
			});
		},
	}
}		
</script>

<style lang="scss">
@import './style.scss';
</style>